---
title: Drop constraint
description: A drop constraint operation drops a single-column constraint from an existing table.
---

<Warning>
  The **drop constraint** operation is deprecated. Please use the [drop
  multi-column constraint](#drop-multi-column-constraint) operation instead. The
  **drop_constraint** operation will be removed in a future release of `pgroll`.
</Warning>

## Structure

Only `CHECK`, `FOREIGN KEY`, and `UNIQUE` constraints can be dropped.

<YamlJsonTabs>
```yaml
drop_constraint:
  table: name of table
  name: name of constraint to drop
  up: SQL expression
  down: SQL expression
```
```json
{
  "drop_constraint": {
    "table": "name of table",
    "name": "name of constraint to drop",
    "up": "SQL expression",
    "down": "SQL expression"
  }
}
```
</YamlJsonTabs>

## Examples

### Drop a `CHECK` constraint:

Drop a `CHECK` constraint:

<ExampleSnippet example="23_drop_check_constraint.yaml" languange="yaml" />

### Drop a `FOREIGN KEY` constraint:

Drop a `FOREIGN KEY` constraint:

<ExampleSnippet example="24_drop_foreign_key_constraint.yaml" languange="yaml" />

### Drop a `UNIQUE` constraint:

Drop a `UNIQUE` constraint:

<ExampleSnippet example="27_drop_unique_constraint.yaml" languange="yaml" />
